package com.solution.admin.finance.wallet.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.solution.admin.finance.wallet.dao.WalletWithdrawDao;
import com.solution.admin.finance.wallet.entity.WalletWithdrawEntity;
import com.solution.admin.finance.wallet.service.WalletWithdrawService;

import com.solution.common.dao.BaseDao;
import com.solution.common.page.PageBean;
import com.solution.common.page.PageParam;
import com.solution.common.service.impl.BaseServiceImpl;

/**
 * 客户钱包提现service实现层
 * @author lufer
 * @date 2018-05-04 16:52:30
 */
@Service
public class WalletWithdrawServiceImpl extends BaseServiceImpl<WalletWithdrawEntity> implements WalletWithdrawService {

	/**
	 * 客户钱包提现接口
	 */
	@Autowired
	private WalletWithdrawDao walletWithdrawDao;

	protected BaseDao<WalletWithdrawEntity> getDao() {
		return this.walletWithdrawDao;
	}

	/**
	 * 保存客户钱包提现
	 * @param walletWithdrawEntity 客户钱包提现实体
	 * @return Long 添加成功客户钱包提现的ID
	 * @author lufer
	 * @date 2018-05-04 16:52:30
	 */
	public long saveWalletWithdraw(WalletWithdrawEntity walletWithdrawEntity) {
		return walletWithdrawDao.saveWalletWithdraw(walletWithdrawEntity);
	}

	/**
	 * 分页查询客户钱包提现
	 * @param pageParam 分页参数
	 * @param paramMap 查询参数
	 * @return PageBean 分页参数和分页数据
	 * @author lufer
	 * @date 2018-05-04 16:52:30
	 */
	@Override
	public PageBean listWalletWithdrawPage(PageParam pageParam, Map<String, Object> paramMap) {
		return walletWithdrawDao.listWalletWithdrawPage(pageParam, paramMap);
	}
	
	/**
	 * 根据ID查询用户信息
	 * @param id 用户id
	 * @return walletWithdrawEntity 用户对象
	 * @author lufer
	 * @date 2018-05-04 16:52:30
	 */
	public WalletWithdrawEntity getWalletWithdrawById(Long id) {
		return walletWithdrawDao.getById(id.longValue());
	}

	/**
	 * 更新用户
	 * @param walletWithdrawEntity 用户实体
	 * @return Long 更新是否成功，>1代表更新成功
	 * @author lufer
	 * @date 2018-05-04 16:52:30
	 */
	@Override
	public int updateWalletWithdraw(WalletWithdrawEntity walletWithdrawEntity) {
		return walletWithdrawDao.updateWalletWithdraw(walletWithdrawEntity);
	}
	
	
	/**
	 * 根据条件查询客户钱包提现
	 * @param param
	 * @return 数据列表
	 * @author lufer
	 * @date 2018-05-04 16:52:30
	 */
	@Override
	public List<WalletWithdrawEntity> listWalletWithdraw( Map<String, Object> param){
		return  walletWithdrawDao.listWalletWithdraw(param);
	}
	
	/**
	 * 删除客户钱包提现
	 * @param 
	 * @return int 返回删除记录条数
	 * @author lufer
	 * @date 2018-05-04 16:52:30
	 */
	public int deleteWalletWithdrawById(long id){
		return  walletWithdrawDao.deleteById(id);
	}
	
}
